#include "SDL/SDL.h"
#ifndef SPRITES
#include "sprite.h"
#endif


class Monster : public Sprite
{
	public:
		float difficulty;
		void move();
		void move(int PlayerX, int PlayerY);
		void update();
		void shot();
		Monster();
};

Monster::Monster()
{
	x = 0;
	y = 0;
	acc_x = 0;
	acc_y = 0;
	rot = 0;
}

void Monster::shot()
{
	difficulty += 0.1f;
	x = 100;
	y = 100;
}

void Monster::move (int playerX,int playerY)
{
	if (playerX < x)
	{
		acc_x = -difficulty*((float)abs(playerX-x)/10);
		//--x;
	}
	else if (playerX > x)
	{
		acc_x =  difficulty*((float)abs(playerX-x)/10);
		//++x;
	}
	if (playerY < y)
	{
		acc_y = -difficulty*((float)abs(playerY-y)/10);
		//--y;
	}
	else if (playerY > y)
	{
		acc_y =  difficulty*((float)abs(playerY-y)/10);
		//++y;
	}
	update();
}

void Monster::update()
{
	x += acc_x;
	y += acc_y;
}
